package gold.digger;

import gold.utils.InputUtil;

/**
 * Created by fanzhenyu02 on 2021/12/10.
 * common problem solver template.
 */
public class LC883 {
    public long startExecuteTime = System.currentTimeMillis();


    class Solution {
        public int projectionArea(int[][] g) {
            int ans1 = 0, ans2 = 0, ans3 = 0;
            int n = g.length;
            for (int i = 0; i < n; i++) {
                int a = 0, b = 0;
                for (int j = 0; j < n; j++) {
                    if (g[i][j] > 0) ans1++;
                    a = Math.max(a, g[i][j]);
                    b = Math.max(b, g[j][i]);
                }
                ans2 += a;
                ans3 += b;
            }
            return ans1 + ans2 + ans3;
        }
    }

    public void run() {
        int[] arr = InputUtil.toIntegerArray("[1,2,3]");
        System.out.println(new Solution().toString());
    }

    public static void main(String[] args) throws Exception {
        LC883 an = new LC883();
        an.run();

        System.out.println("\ncurrent solution total execute time: " + (System.currentTimeMillis() - an.startExecuteTime) + " ms.");
    }
}
